<%@ page contentType="text/html; charset=UTF-8"%>
	<form action="downloadfile" method="post" id="downForm" name="downForm">
		<input type="hidden" id="downloadFileName" name="downloadFileName" value=""/>
   </form>	
	<script type="text/javascript">
		String.prototype.endWith=function(str){  
			 if(str==null||str==""||this.length==0||str.length>this.length){  
			   return false;  
			 }if(this.substring(this.length-str.length)==str){ 
			   return true;  
			 }else{  
			   return false;
			 }
			 return true;  
		};
		function openAtta(fileName,urlRewri){
			if(typeof fileName!="undefined"){
				$("downloadFileName").value=fileName;
			}else if($("attachUrl").value!=""){
				$("downloadFileName").value=$("attachUrl").value;
			}else{
				return;
			}
			if(typeof urlRewri!="undefined"||$("downloadFileName").value.endWith(".pdf")||$("downloadFileName").value.endWith(".PDF"))
				$("downForm").action=conextPath+"/fileUpload?cmd=download";
			else
			   $("downForm").action=conextPath+"/fileUpload?cmd=download";
			$("downForm").submit();
		}
		function getTemplate(fileName){
			if(typeof fileName!="undefined")
				$("downloadFileName").value=fileName;
			else
			   return;	
			$("downForm").action=conextPath+"/fileUpload?cmd=getTemplate";
			$("downForm").submit();
		}
	</script>